package org.coco.cloud.order.feign.fallback;

import org.coco.cloud.order.feign.ProductFeignClient;
import org.coco.cloud.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @Description
 * @Author fengleifl-hzgs
 * @Date 2025/2/6
 * @since
 */
@Component
public class ProductFeignClientFallBack implements ProductFeignClient {
    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调 ...");
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal(99));
        product.setProductName("FallBack-" + id);
        product.setNum(0);
        return product;
    }
}
